//===COMMENT===

package bubble3d.primitives {
	
import bubble3d.core3d.Object3D;
import bubble3d.model.Vertex;
import bubble3d.model.Face;

public class Tetrahdron3D extends Object3D {
	
	private var triSize:Number;
	
	function Tetrahdron3D(triSize){
		
		triSize = triSize;
		var t = triSize/2;
		var r = t/Math.sqrt(2);
	
		var tc = new Vertex(0, -2*r, -r);
		var lf = new Vertex(-t, 0, 0);
		var rf = new Vertex(t, 0, 0);
		var bb = new Vertex(0, 0, -2*r);	
	
		
		addVertex(tc);
		addVertex(lf);
		addVertex(rf);
		addVertex(bb);

		// front
		var a = new Face(tc, rf, lf, "front", 0xFF0000);
		// right
		var b = new Face(tc, bb, rf, "right", 0x00FF00);
		// left
		var c = new Face(tc, lf, bb, "left", 0x8F2C75);
		// bottom
		var d = new Face(rf, bb, lf, "bottom", 0x0000FF);

		addFace(a);
		addFace(b);
		addFace(c);
		addFace(d);
	}
}

}